package com.base.system.managedBean;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.operamasks.faces.annotation.Action;
import org.operamasks.faces.annotation.ManagedBean;
import org.operamasks.faces.annotation.ManagedBeanScope;
import org.operamasks.faces.user.util.Browser;

import com.base.security.SecurityConst;
import com.base.security.entity.SecurityRole;
import com.base.system.managedBean.baseBean.BaseSecurityRoleBean;

/**
 * 
 * This managed bean is generated automatically
 */
@ManagedBean(name = "system_addSecurityRoleBean", scope = ManagedBeanScope.REQUEST)
public class AddSecurityRoleBean extends BaseSecurityRoleBean {
	Log logger = LogFactory.getLog(AddSecurityRoleBean.class);

	@Action(id = "saveSecurityRole")
	public void saveSecurityRole() {
		securityRole = new SecurityRole();
		setSecurityRoleProperty();
		securityEntityManager.saveRole(securityRole);
		String script = "closeCenterLayoutTab('"
				+ SecurityConst.SECURITYROLE_ADD_TAB + "')";
		Browser.execClientScript("window.top", script);
	}
}
